<?php

class ProvincePlaces extends Eloquent
{
    protected $guarded = array();

    public static $rules = array();
    protected $table = 'pronvince_places';

    public function province()
    {
        return $this->belongsTo('Province', 'province_id');
    }
    public function place()
    {
        return $this->belongsTo('Place', 'place_id');
    }
    /**
     * Get the post's locations.
     *
     * @return array
     */
    public function locations()
    {
        return $this->hasMany('Location');
    }
    public static function getBranches($province_id)
    {
        return self::with('place', 'province')
            ->where('province_id', $province_id)
            ->get();
    }

}
